package com.zxt.content.copywriting.manager;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxt.content.copywriting.mapper.UserCopywritingConfigMapper;
import com.zxt.content.copywriting.model.UserCopywritingConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 通用逻辑层-用户文案配置管理类
 *
 * @author zxt
 */
@Slf4j
@Service
public class UserCopywritingConfigManager extends ServiceImpl<UserCopywritingConfigMapper, UserCopywritingConfig> {

    public List<UserCopywritingConfig> queryList() {
        return list();
    }

    public List<UserCopywritingConfig> getEnablePushUser() {
        LambdaQueryWrapper<UserCopywritingConfig> wrapper = UserCopywritingConfig.gw();
        wrapper.eq(UserCopywritingConfig::getCopywritingPushEnable, Boolean.TRUE);
        return list(wrapper);
    }
}
